/*
 * Corpus.h
 *
 *  Created on: Feb 9, 2015
 *      Author: Phong
 */

#ifndef CORPUS_H_
#define CORPUS_H_

#include <stdlib.h>
#include <vector>
#include "Container.h"

using namespace std;

template <class T>
class Corpus : public Container {
public:
	vector<T> storage;
    Corpus() : Container() {}

	virtual void shuffle() {
		for (int i = (int)storage.size() - 1; i > 0; i--)
		{
			int index = rand() % storage.size();
			T temp = storage[index];
			storage[index] = storage[i];
			storage[i] = temp;
		}
	}

    virtual inline int size() {return (int)storage.size();}
    inline T get(int i) { return storage[i]; }

protected:
    virtual ~Corpus() {};

};

#endif /* CORPUS_H_ */
